﻿@model iemtm.WeChat.Web.Entry.Areas.Admin.Model.AnnouceAuditDetailModel
@{
    ViewBag.Title = "工单详情";
    Layout = null;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>中国铁塔油机管理系统-@ViewBag.Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="~/Content/css/frozenui.css">
    <link rel="stylesheet" href="~/Content/css/style.css">
    <link rel="stylesheet" href="~/Content/css/swiper.min.css">
    <link href="~/Content/css/aui.css" rel="stylesheet" />
    <script src="~/Content/script/swiper.min.js"></script>
    <script src="~/Content/script/jquery-3.3.1.min.js"></script>
    <link rel="stylesheet" href="~/Content/css/weui.min.css">
    <link rel="stylesheet" href="~/Content/css/jquery-weui.min.css">
    <script src="~/Content/script/jquery-1.11.0.min.js"></script>
    <script src="~/Content/script/jquery-weui-1.2.1.min.js"></script>


    <style>
        * {
            padding: 0;
            margin: 0;
        }

        html, body {
            position: relative;
            height: 100%;
        }

        li, a {
            list-style: none;
            text-decoration: none;
        }

        .swiper-container {
            width: 100%;
        }

        #nav {
            background: #fff;
        }

            #nav .swiper-wrapper {
                box-sizing: border-box;
                margin: 0;
                line-height: 1.6rem;
            }

            #nav li {
                text-align: center;
                color: #424242;
                font-size: 0.63rem;
            }

                #nav li span {
                    color: #3597D9;
                }

            #nav .active-nav {
                color: #2ECA70;
                border-bottom: 2px solid #2ECA70;
            }

                #nav .active-nav span {
                    color: #2ECA70;
                }



        #page {
            position: absolute;
            top: 1.68rem;
            left: 0;
            right: 0;
            bottom: 1.6rem;
            overflow: hidden;
        }

            #page .swiper-slide {
                text-align: center;
                overflow-y: scroll;
                position: relative;
                padding-top: 5px;
                box-sizing: border-box;
            }

        #tableHeader {
            height: 1.6rem;
        }

            #tableHeader table {
                width: 100%;
                height: 1.6rem;
                color: #fff;
                font-size: 0.6rem;
            }

                #tableHeader table tr th {
                    text-align: center;
                }

                #tableHeader table th:nth-child(even) {
                    background: #4FC2A1;
                }

                #tableHeader table th:nth-child(odd) {
                    background: #334960;
                }

        #content {
            position: absolute;
            top: 2.1rem;
            left: 0;
            right: 0;
            bottom: 0;
            overflow-y: scroll;
        }

            #content table {
                /*background: #fff;*/
                width: 100%;
                border-bottom: 1px solid #ccc;
            }

                #content table td {
                    word-break: break-word;
                    text-align: center;
                    border-right: 1px solid #ccc;
                }

                #content table tr td:last-child {
                    border-right: none;
                }

        #page table tr:nth-child(even) {
            background: #F8F8F8;
        }

        #page tr td {
            font-size: 0.64rem;
            color: #000;
            padding: 10px 0;
            font-family: "微软雅黑";
        }

            #page tr td:nth-child(1) {
                width: 20%;
            }

            #page tr td:nth-child(2), #page tr td:nth-child(3) {
                width: 25%;
            }

            #page tr td:nth-child(4), #page tr td:nth-child(5) {
                width: 15%;
            }



        #footer {
            position: absolute;
            height: 1.6rem;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 0;
            margin: 0;
            background-color: #00bcd4;
        }

            #footer .ui-btn-primary {
                height: 1.6rem;
                width: 100%;
                line-height: 1.6rem;
                font-size: 0.68rem;
            }
    </style>
</head>
<body>



    <div id="nav" class="swiper-container">
        <ul class="swiper-wrapper">
            <li class="swiper-slide active-nav">工单详情</li>
            @*<li class="swiper-slide">发电记录</li>*@
        </ul>
    </div>

    <div class="swiper-container" id="page">
        <div class="swiper-wrapper">
            <div class="swiper-slide slidepage">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>动环工单号:</td>
                        <td id="">
                            @Model.AnnounceList.JobNumber
                        <input type="hidden" id="AnnounceId" name="AnnounceId" value="@Model.AnnounceList.AnnounceId">
                        <input type="hidden" id="AnnounceCode" name="AnnounceCode" value="@Model.AnnounceList.AnnounceCode">
                    </td>

                </tr>
                <tr>
                    <td>发电基站名称:</td>
                    <td>@Model.AnnounceList.BaseStation</td>
                </tr>
                <tr>
                    <td>站址编码:</td>
                    <td>@Model.BaseStationTTCode</td>
                </tr>
                <tr>
                    <td>发电给:</td>
                    <td>@Model.AnnounceList.GenerationFor</td>
                </tr>
                <tr>
                    <td>状态:</td>
                    <td class="aui-text-info">@Model.AnnouceStatus</td>
                </tr>
                <tr>
                    <td>工单告警时间:</td>
                    <td>@Model.AnnounceList.AlarmBeginTime</td>
                </tr>
                <tr>
                    <td>动环建单时间:</td>
                    <td>@Model.AnnounceList.ExecutionDate</td>
                </tr>
                <tr>
                    <td>发电区域:</td>
                    <td>@Model.AnnounceList.AreaName</td>
                </tr>
                <tr>
                    <td>接单人员:</td>
                    <td>@Model.AnnounceList.AcceptPersonName</td>
                </tr>

                <tr>
                    <td>接单人代维公司:</td>
                    <td>@Model.AnnounceList.AcceptCompanyName</td>
                </tr>
                @*<tr>
                        <td>带载时长:</td>
                        <td>@Model.CountPeriod.ToString("0.00")H (<span>@{ Model.CountPeriod = Model.CountPeriod * 60;}@Model.CountPeriod.ToString("0.0")</span>分)</td>
                    </tr>*@
                <tr>
                    <td>发电开始时间:</td>
                    <td>@Model.AnnFee.GenStart</td>
                </tr>
                <tr>
                    <td>发电结束时间:</td>
                    <td>@Model.AnnFee.GenStop</td>
                </tr>
                <tr>
                    <td>发电电量:</td>
                    <td>@Model.AnnFee.KWpower KW</td>
                </tr>

                <tr>
                    <td>油机:</td>
                    <td>
                        @Model.GensetNum
                    </td>
                </tr>
                <tr>
                    <td>采集器:</td>
                    <td>
                        @Model.AnnounceList.RegisteredDtuId
                    </td>
                </tr>
                <tr>
                    <td>是否发电记录申述:</td>
                    <td class="aui-text-info">
                        @if (Model.AnnounceList.GenRecordAppeal == true)
                        {
                            @("是")
                        }
                        else
                        {
                            @("否")
                        }
                    </td>
                </tr>
                <tr>
                    <td>是否为手工单:</td>
                    <td class="aui-text-info">
                        @if (Model.AnnounceList.IsManual == true)
                        {
                            @("是")
                        }
                        else
                        {
                            @("否")
                        }
                    </td>
                </tr>
                <tr>
                    <td>是否为多签工单:</td>
                    <td class="aui-text-info">
                        @if (Model.AnnounceList.IsReBinGenset == true)
                        {
                            @("是")
                        }
                        else
                        {
                            @("否")
                        }
                    </td>
                </tr>
                <tr>
                    <td>是否更换过油机:</td>
                    <td class="aui-text-info">
                        @if (Model.AnnounceList.IsChangeGenset == true)
                        {
                            @("是")
                        }
                        else
                        {
                            @("否")
                        }
                    </td>
                </tr>
                @if (Model.AnnounceList.AnnounceStatus > 29)
                {
                    <tr>
                        <td>铁塔审核人:</td>
                        <td>
                            @Model.AnnounceList.AuditName
                        </td>
                    </tr>
                    <tr>
                        <td>铁塔审核备注:</td>
                        <td>
                            @Model.AnnounceList.AuditRemark
                        </td>
                    </tr>
                }
            </table>
            @{
                if (Model.AnnounceList.AnnounceStatus == 29 || Model.AnnounceList.AnnounceStatus == 33 || Model.AnnounceList.AnnounceStatus == 34)
                {
                    @*<div class="weui-cells weui-cells_form">
                            <div class="weui-cells__title">审核备注</div>
                            <div class="weui-cells">
                                <div class="weui-cell">
                                    <div class="weui-cell__bd">
                                        <input class="weui-input" id="AuditRemark" type="text" placeholder="请输入审核备注">
                                    </div>
                                </div>
                            </div>
                        </div>*@
                }

            }

        </div>



        @*<div class="swiper-slide slidepage">
                <div id="tableHeader">
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <th width="20%">模块编号</th>
                            <th width="25%">开始</th>
                            <th width="25%">结束</th>
                            <th width="15%">空/带载(H)</th>
                            <th width="15%">距离(米)</th>
                        </tr>
                    </table>
                </div>
                <div id="content">
                    <table cellpadding="0" cellspacing="0">
                        @{
                            foreach (var item in Model.GenRecord)
                            {
                                <tr>
                                    <td>@item.DTUID</td>
                                    <td>@item.GenStart.ToString("MM-dd HH:mm")</td>
                                    <td>@item.GenStop.ToString("MM-dd HH:mm")</td>
                                    <td>@item.EmptyloadPeriod.ToString("0.00")/@item.RunningPeriod.ToString("0.00")</td>
                                    <td>@item.Distance.Value.ToString("0")</td>
                                </tr>
                            }
                        }
                    </table>
                </div>
            </div>*@
    </div>


</div>


<section class="ui-container actionOne">
    <section id="actionsheet">
        <div class="demo-item">
            <div class="demo-block">
                <div class="ui-actionsheet" id="actionsheet1">
                    <div class="ui-actionsheet-cnt am-actionsheet-down">
                        <h4>选择操作菜单</h4>
                        @{
                            if (Model.AnnounceList.AnnounceStatus == 29 || Model.AnnounceList.AnnounceStatus == 33 || Model.AnnounceList.AnnounceStatus == 34)
                            {
                                //<button id="AnnPass">审核通过</button>
                                //<button id="AnnNoPass">审核不通过</button>
                                <button onclick="selectAnnAuditP()">审核</button>
                            }

                        }
                        <button id="returnList">返回列表</button>
                        <div class="ui-actionsheet-split-line"></div>
                        <button id="cancel">取消</button>
                    </div>
                </div>
            </div>
        </div>
    </section>
</section>

<div class="ui-btn-wrap" id="footer">
    <button class="ui-btn-primary">
        操作
    </button>
</div>

<script>
            (function (designWidth, maxWidth) {
                var html = document.getElementsByTagName("html")[0];
                var tid;
                function refreshRem() {
                    var width = html.getBoundingClientRect().width;
                    html.style.fontSize = width / 15 + "px"
                }
                window.addEventListener("resize", function () {
                    clearTimeout(tid); //防止执行两次
                    tid = setTimeout(refreshRem, 300);
                }, false);
                refreshRem();
            })();


            (function (doc, win) {

                var size = 10;
                var myNav = new Swiper('#nav', {
                    spaceBetween: 10,
                    slidesPerView: 1,
                    watchSlidesProgress: true,
                    watchSlidesVisibility: true,
                    on: {
                        tap: function () {
                            myPage.slideTo(myNav.clickedIndex)
                        }
                    }
                });

                var myPage = new Swiper('#page', {
                    on: {
                        slideChangeTransitionStart: function () {
                            updateNavPosition()
                        }
                    }
                });

                function updateNavPosition() {
                    $('#nav .active-nav').removeClass('active-nav');
                    var activeNav = $('#nav .swiper-slide').eq(myPage.activeIndex).addClass('active-nav');
                    if (!activeNav.hasClass('swiper-slide-visible')) {

                        if (activeNav.index() >= myNav.activeIndex) {
                            var thumbsPerNav = Math.floor(myNav.width / activeNav.width()) - 1
                            myNav.slideTo(activeNav.index() - thumbsPerNav)
                        } else {
                            myNav.slideTo(activeNav.index())
                        }
                    }
                }

                $("#footer").click(function () {
                    $('.ui-actionsheet').addClass('show');

                });

                $("#cancel").click(function () {
                    $(".ui-actionsheet").removeClass("show");
                });

                $("#goBack").click(function () {

                    window.history.back()
                })

            })(document, window);

        //审核 通过
            $("#AnnPass").click(function () {
                var AnnounceCode = $("#AnnounceCode").val();
                var GenImg1 = $("#AnnounceId").val();
                var AnnounceStatus = 30;
                var AuditRemark = $("#AuditRemark").val();
                $.ajax({
                    url: "/AnnouceAudit/AnnAudit",
                    type: "get",
                    data: { GenImg1: GenImg1, AnnounceStatus: AnnounceStatus, AuditRemark: AuditRemark },
                    beforeSend: function () {
                        $.showLoading("提交中...");
                    },
                    success: function (data) {
                        console.log(data);
                        if (data.code == 1)
                        {
                            $.toast(data.result);
                            setTimeout(function () {
                                location.href = "/AnnouceAudit/Detail?annouceCode=" + AnnounceCode + "";

                            }, 1 * 1000);
                           // alert(data.result);
                           // location.href = "/AnnouceAudit/Index";
                        }
                    },
                    error: function () {
                        $.alert("error :请求出错", "提示！");
                        //alert("error :请求出错")
                    }
                })
            //    alert(AuditRemark)
                //location.href = "/AnnouceList/ReplyGenset?annouceCode=" + $("#annouceCode").html() + "&AnnounceStatus=" +@Model.AnnounceList.AnnounceStatus+"&userCode=@Model.AnnounceList.AcceptPersonCode";
            })
            //审核不通过
           $("#AnnNoPass").click(function () {
               // location.href = "/AnnouceList/ReplyGenset?annouceCode=" + $("#annouceCode").html() + "&AnnounceStatus=" +@Model.AnnounceList.AnnounceStatus+"&userCode=@Model.AnnounceList.AcceptPersonCode";
               var AnnounceCode = $("#AnnounceCode").val();
               var GenImg1 = $("#AnnounceId").val();
               var AnnounceStatus = 31;
               var AuditRemark = $("#AuditRemark").val();
               $.ajax({
                   url: "/AnnouceAudit/AnnAudit",
                   type: "get",
                   data: { GenImg1: GenImg1, AnnounceStatus: AnnounceStatus, AuditRemark: AuditRemark },
                   beforeSend: function () {
                       $.showLoading("提交中...");
                   },
                   success: function (data) {
                       console.log(data);
                       if (data.code == 1) {
                           //   alert(data.result);
                           $.toast(data.result);
                           setTimeout(function () {
                               location.href = "/AnnouceAudit/Detail?annouceCode=" + AnnounceCode + "";
                               //   location.href = "/AnnouceList/Detail?annouceCode=" + annouceCode + "";
                           }, 1 * 1000);
                           //$.alert(data.result, "提示！");
                           //location.href = "/AnnouceAudit/Index";
                       }
                   },
                   error: function () {
                       $.alert("error :请求出错", "提示！");
                       //alert("error :请求出错")
                   }
               })
           })

            //返回列表
            $("#returnList").click(function () {
                location.href = "/AnnouceAudit/Index";
            });

            function selectAnnAuditP()
            {

                var AnnounceCode = $("#AnnounceCode").val();
                var GenImg1 = $("#AnnounceId").val();
                location.href = "/AnnouceAudit/Audit?GenImg1=" + GenImg1 + "&AnnounceCode=" + AnnounceCode+"";
            }
        //审核方法
            function AnnPassNoPass(state){
                var AnnounceCode = $("#AnnounceCode").val();
                var GenImg1 = $("#AnnounceId").val();
                var AnnounceStatus = state;
                var AuditRemark = $("#AuditRemark").val();
                $.ajax({
                    url: "/AnnouceAudit/AnnAudit",
                    type: "get",
                    data: { GenImg1: GenImg1, AnnounceStatus: AnnounceStatus, AuditRemark: AuditRemark },
                    beforeSend: function () {
                        $.showLoading("提交中...");
                    },
                    success: function (data) {
                        console.log(data);
                        if (data.code == 1) {
                            //   alert(data.result);
                            $.toast(data.result);
                            setTimeout(function () {
                                location.href = "/AnnouceAudit/Detail?annouceCode=" + AnnounceCode + "";
                                //   location.href = "/AnnouceList/Detail?annouceCode=" + annouceCode + "";
                            }, 1 * 1000);
                            //$.alert(data.result, "提示！");
                            //location.href = "/AnnouceAudit/Index";
                        }
                    },
                    error: function () {
                        $.alert("error :请求出错", "提示！");
                        //alert("error :请求出错")
                    }
                })
            }

</script>
</body>
</html>
